import { onMounted, ref } from "vue";
import { getSubCategoryList } from "@/apis/SubCategory";
import { useRoute } from "vue-router";
export const useSubcategory = () => {
  const route = useRoute();
  const list = ref({});
  const getSubCategoryData = async () => {
    const {
      data: { result },
    } = await getSubCategoryList(route.params.id);
    list.value = result;
  };

  onMounted(() => {
    getSubCategoryData();
  });
  return {
    list,
  };
};
